package com.zxw.java基础.字符串;

/**
 * @projectName: util-cloud
 * @package: com.zxw.java基础.字符串
 * @className: 截取
 * @author: zhangxuewei
 * @description:
 * @date: 2025/8/4 9:48
 * @version: 1.0
 */
public class 截取 {
    public static void main(String[] args) {
        String resStr = "11111";

        if (resStr.length() > 4) {
            resStr = resStr.substring(0, 4);
        }


        System.out.println(resStr);
    }
}
